<?php echo $this->Form->create('CambiordenesTag', array('id' => "validate")); ?>
  <div id="sheepItForm">
        <!-- Form template-->
        <div id="sheepItForm_template">
                <div class="formRow">
                <div class="grid2"><label><span id="sheepItForm_label"></span>.- Tag de la Orden :</label></div>
                <div class="grid2 moreFields allUpper">
                    <?php echo $this->Form->hidden('#index#.cambiordene_id', array('value'=>$idCambio)); ?>
                    <?php echo $this->Form->text('#index#.tag_id', array('placeholder' => 'Inserte Tag Orden')); ?>
                </div>
                <div class="grid2"><label>Numero Activo :</label></div>
                <div class="grid2">
                    <?php echo $this->Form->text('#index#.nactivo', array('placeholder' => 'Inserte nactivo')); ?>
                </div>
                <div class="grid2"><label>Monto :</label></div>
                <div class="grid2">
                    <?php echo $this->Form->text('#index#.monto', array('placeholder' => 'Inserte Monto',"class" => "validate[required]")); ?>
                    <a id="sheepItForm_remove_current" style="float: left">
                        X<img class="delete" src="/images/cross.png" width="16" height="16" border="0">
                    </a>
                </div>
                <div class="clear"></div>                 
            </div>
        </div>   
        <!-- /Form template-->                  
        <!-- No forms template -->
        <div id="sheepItForm_noforms_template">Ningun Tags</div>
        <!-- /No forms template-->

        <!-- Controls -->
        <div id="sheepItForm_controls">
            <div id="sheepItForm_add"><a class="buttonS bGreen"><span>(+)Mas Tags</span></a></div>
            <div id="sheepItForm_remove_last"><a class="buttonS bRed"><span>(-)Quitar</span></a></div>
            <div id="sheepItForm_remove_all"><a class="buttonS bRed"><span>(-)Quitar Todos</span></a></div>
            <div id="sheepItForm_add_n">
                <input id="sheepItForm_add_n_input" type="text" size="4" style="border: 1px solid #006;"/>
                <div id="sheepItForm_add_n_button"><a class="buttonS bGold"><span>Anadir</span></a></div></div>
        </div>
        <!-- /Controls -->

    </div>
    <!-- /sheepIt Form -->          

    <div class="clear"></div>

    <div class="formRow">
        <?php
        $options = array(
            'label' => 'Guardar Datos',
            'class' => 'buttonS bLightBlue',
            'id' => 'btEnvia'
        );
        echo $this->Form->end($options);
        ?> 
        <div class="clear"></div>        
    </div>
<script>
    $(document).ready(function() {
        
        $( "#fechaPed" ).datepicker({
            defaultDate: +7,
            showOtherMonths:true,
            autoSize: true,
            /*appendText: '(Ano-Mes-Dia)',*/
            dateFormat: 'yy-mm-dd',
            changeMonth: true,
            changeYear: true
        });        
        /* Init the table */
        var oTable = $('.dTable').dataTable( );
        
        /* Add/remove class to a row when clicked on */
        $('.dTable tr').click( function() {
            $(this).toggleClass('row_selected');               
        } );
        
        $('#btEnvia').hover( function() {
            //$(this).toggleClass('row_selected');  
            $.fn.getCheckboxValues = function(){
                var values = [];
                var i = 0;
                this.each(function(){
                    values[i++] = $(this).val();
                });
                return values;
            } 

            var arr = $("input:checked").getCheckboxValues();
            $("#seleccionados").val(arr);
            console.log('es'+arr);
        } );
        
        var sheepItForm = $('#sheepItForm').sheepIt({
            separator: '',
            allowRemoveLast: true,
            allowRemoveCurrent: true,
            allowRemoveAll: true,
            allowAdd: true,
            allowAddN: true,
            maxFormsCount: 200,
            minFormsCount: 1,
            iniFormsCount: 1,
            continuousIndex: true
        });              
            
    } );                 
    
</script>